import Vue from 'vue';
import App from './App.vue';
import VueRouter from 'vue-router';
import Vuex from 'vuex';
import ThirdBlock from './views/ThirdBlock.vue';
import ImageCss from './views/ImageCss.vue';
import AlgorithmQuestion from './views/AlgorithmQuestion.vue';
import DynamicRoute from './views/DynamicRoute.vue';
import LoginBlock from './views/LoginBlock.vue';

Vue.config.productionTip = false;
Vue.use(VueRouter);
Vue.use(Vuex);

const routes = [
  { path: '/', component: ImageCss },
  { path: '/second', component: AlgorithmQuestion },
  { path: '/third', component: ThirdBlock },
  { path: '/fourth', component: DynamicRoute },
  { path: '/login', component: LoginBlock },
];

const router = new VueRouter({
  routes
});

const store = new Vuex.Store({
  state: {
    userPermissions: ['system:add', 'system:read'],
  },
  getters: {
    userPermissions: state => state.userPermissions,
  },
});

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app');
